package com.zy;

import com.zy.bean.Contributor;
import com.zy.restApi.Github;
import feign.Feign;
import feign.gson.GsonDecoder;

import java.util.List;

/**
 * @program: shopping153_cloud
 * @description:
 * @author: zy
 * @create: 2025-08-23 10:47
 */
public class App1 {
    public static void main(String[] args) {
        Github github = Feign.builder()   // 通过构建器模式创建 一个Feign的客户端
                .decoder(new GsonDecoder())     //设置 解码器为Gson解码器
                .target(Github.class, "https://api.github.com");
        //以上github是一个jdk的动态代理对象

        List<Contributor> contributors = github.contributors("OpenFeign", "feign");
        for (Contributor contributor : contributors) {
            System.out.println(contributor);
        }
    }
}
